<script type ="text/javascript" src="../date/jquery.jdpicker.js"></script>
<link rel="stylesheet" href="../date/jdpicker.css" type="text/css" media="screen" /> 
	<script type="text/javascript">
		cotCanHien[0] = 2;
		function guiform() 
		{  
			 document.formgui.submit(); 
		}
		
		function ChuyenMaKhachHang(MaKH){
			document.getElementById('MaKH').value = MaKH;
		}

		function GetThongTinKhachHang(MaKH){
			var xmlHttp;
		    if(window.XMLHttpRequest){
		        xmlHttp = new XMLHttpRequest;
		    }
		    else if(window.ActiveXObject){
		        xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
		    }
		    
		    xmlHttp.onreadystatechange = function(){
		        if(xmlHttp.readyState == 4){
		            var thongTin = xmlHttp.responseText;
		            var mangThongTin = thongTin.split("|");
		            document.getElementById('NgaySinh').value = mangThongTin[0];
		            document.getElementById('DiaChi').value = mangThongTin[1];
		            document.getElementById('SoCMND').value = mangThongTin[2];
		            document.getElementById('NgayCap').value = mangThongTin[3];
		            document.getElementById('NoiCap').value = mangThongTin[4];
		        }
		    }
		    xmlHttp.open('GET', '../adm/nhanvien/taisanthechap/getthongtinkhachhang.php?makh='+MaKH, true);
		    xmlHttp.send(null);
		}
		
		function tinhGiaTriDat(){
		 	var xmlHttp;
		 	var DienTichDat = document.getElementById('DienTichDat').value;
		    if(window.XMLHttpRequest){
		        xmlHttp = new XMLHttpRequest;
		    }
		    else if(window.ActiveXObject){
		        xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
		    }
		    
		    xmlHttp.onreadystatechange = function(){
		        if(xmlHttp.readyState == 4){
		        	document.getElementById('GiaTriTaiSan').value = Math.round(parseFloat(DienTichDat) * 50000000 / 1000);
		        }
		    }
		    xmlHttp.open('GET', '', true);
		    xmlHttp.send(null);
		}

		function ajaxFunction(id){
		    var xmlHttp;
		    if(window.XMLHttpRequest){
		        xmlHttp = new XMLHttpRequest;
		    }
		    else if(window.ActiveXObject){
		        xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
		    }
		    
		    xmlHttp.onreadystatechange = function(){
		        if(xmlHttp.readyState == 4){
		            document.getElementById('MaHinhThucVay').innerHTML = xmlHttp.responseText;
		        }
		    }
		    xmlHttp.open('GET', '../adm/nhanvien/hopdongtindung/comboboxkyhantra.php?dmid='+id, true);
		    xmlHttp.send(null);
		}

		function ajaxFunction2(id){
		    var xmlHttp;
		    if(window.XMLHttpRequest){
		        xmlHttp = new XMLHttpRequest;
		    }
		    else if(window.ActiveXObject){
		        xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
		    }
		    
		    xmlHttp.onreadystatechange = function(){
		        if(xmlHttp.readyState == 4){
		            document.getElementById('MaHinhThucVay2').innerHTML = xmlHttp.responseText;
		        }
		    }
		    xmlHttp.open('GET', '../adm/nhanvien/hopdongtindung/comboboxkyhantra2.php?dmid='+id, true);
		    xmlHttp.send(null);
		}
	</script>


	<?php
		$hopdongtindung = new hopdongtindungbs();
		$danhsach = $hopdongtindung->LayDanhSach();
		
		session_start();
		$nhatky = new nhatkybs();
		$nhatky->TenSuKien = "Xem danh sách hợp đồng tín dụng";
		$nhatky->MaNguoiDung = $_SESSION["MaND"];
		date_default_timezone_set('Asia/Ho_Chi_Minh');
		$nhatky->ThoiGian = date("Y-m-d H:m:s", time());
		$nhatky->Them();
	?>
	<form name="formgui"  method="POST" action="">
	<table id="rounded-corner" class="display" summary="Danh sách hợp đồng tín dụng" border="1">
		<thead>
			<tr>
				<th align="center" colspan="10">
		               	<h2><strong>DANH SÁCH HỢP ĐỒNG TÍN DỤNG</strong></h2>
				</th>
			</tr>
			<tr>					
				<th scope="col" class="rounded">STT</th>
				<th scope="col" class="rounded">Số khế ước</th>
				<th scope="col" class="rounded">Tài khoản</th>
				<th scope="col" class="rounded">Số HĐTC</th>			
				<th scope="col" class="rounded">Ngày lập HĐ</th>
				<th scope="col" class="rounded">Ngày đến hạn</th>
				<th scope="col" class="rounded">Số tiền vay</th>
				<th scope="col" class="rounded">Tất toán</th>
				<th scope="col" class="rounded">Sao kê</th>
				<th scope="col" class="rounded">Phụ lục</th>		
			</tr>
		</thead>
		<tfoot>
	            <tr>
	            	<th>STT</th>
	            	<th>Số khế ước</th>
	                <th>Tài khoản</th>
	                <th>Số HĐTC</th>
	                <th>Ngày lập</th>          
	                <th>Ngày đến hạn</th>
	                <th>Số tiền vay</th>
	                <th>Tất toán</th>   
	                <th>Sao kê</th>
	                <th>Phụ lục</th>                         
	            </tr>
	    </tfoot>
		<tbody>
			<?php
			$stt = 1;
			for($i = 0; $i < ($danhsach == false ? 0 : count($danhsach)); $i++)
			{
					$Khoa = $danhsach[$i]["Khoa"];
					$Active = "<img src='images/active.png' alt='Khóa sổ' title='' border='0' />";
					$Disable = "<img src='images/khoa.png' alt='Khóa sổ' title='' border='0' />";
				echo "<tr>";
						echo "<td>" . ($i + 1) . "</td>";
						echo "<td><a onclick='toggleSua();' href='index.php?do=hopdongtindung&id={$danhsach[$i]["SoKheUoc"]}'>{$danhsach[$i]['SoKheUoc']}</a></td>";
						
						$tstc = new taisanthechapbs();
						$tstc->SoHDTC = $danhsach[$i]['SoHDTC'];
						$dstaisanthechap = $tstc->LayDanhSach();
						
						$kh = new khachhangbs();
						$kh->MaKH = $dstaisanthechap[0]['MaKH'];
						$dskhachhang = $kh->LayDanhSach();
						echo "<td>{$dskhachhang[0]['MaKH']}</td>";
						echo "<td>{$danhsach[$i]['SoHDTC']}</td>";					
						echo "<td>{$danhsach[$i]['NgayLapHopDong']}</td>";
						echo "<td>{$danhsach[$i]['NgayDenHan']}</td>";
						echo "<td>{$danhsach[$i]['SoTienVay']}</td>";									
						echo "<td>";
						if ($Khoa == 0)
							echo $Active;
						else
							echo $Disable;
						echo "</td>";
						echo "<td><a href='index.php?do=saokelaphopdongtindung&id={$danhsach[$i]["SoKheUoc"]}' ><img src='images/printer.png' alt='Sao kê' title='' border='0' /></a></td>";
						if($Khoa==0)
						{
						if($danhsach[$i]['SoTienVay'] !=0)
							echo "<td><a href='index.php?do=phuluchopdong&id={$danhsach[$i]["SoKheUoc"]}' ><img src='images/copy.png' alt='Phụ lục' title='' border='0' /></a></td>";
						else
							echo "<td><img src='images/khoa.png'></td>";
						}
						else
						{
							echo "<td><img src='images/khoa.png'></td>";
						}
					echo "</tr>";
						$stt++;
				}
				?>
		</tbody>
	</table>
	</form>
	<br/><br/>
	<?php
		$hopdongtindung = new hopdongtindungbs();
		$hopdongtindung->SoKheUoc = $_GET['id'];
		$hopdongtindungcansua = $hopdongtindung->LayDanhSach();
		$MaKHT = $hopdongtindungcansua[0]['MaKyHanTra'];
		$kht = new kyhantrabs();
		$kht->MaKyHanTra = $MaKHT;
		$dskht = $kht->LayDanhSach();
		$MaHTV = $dskht[0]['MaHinhThucVay'];
		session_start();
		$nhatky = new nhatkybs();
		$nhatky->TenSuKien = "Xem thông tin hợp đồng tín dụng";
		$nhatky->MaNguoiDung = $_SESSION["MaND"];
		date_default_timezone_set('Asia/Ho_Chi_Minh');
		$nhatky->ThoiGian = date("Y-m-d H:m:s", time());
		$nhatky->Them();
	?>
	<br/>
	<div class="form" id="tdSua" style="<?php if($_GET['id']!="") echo "display:block"; else echo "display:none"; ?>">
	<form enctype="multipart/form-data" name="formgui"  method="post" action="index.php?do=suahopdongtindung_xuly" onsubmit="return checkPostArtForm(this);">
	<h2>
		<strong>Thông tin hợp đồng tín dụng</strong>
	</h2>
	<table style="width:950px; margin-left: 10px; table-layout: fixed;">
		<tr>
			<td style="width:20px;padding-top:10px;">
	        	<label for="mataisanthechap">Số khế ước:</label>        	
	        </td>
	        <td style="width:60px;padding-top:10px;">
	            <input readonly="readonly" tabindex="1" type="text" id="SoKheUoc" name="SoKheUoc" class="txt" size="12" value="<?php echo $_GET["id"];?>"/>  
	        </td>
	        <td style="width:20px;padding-top:10px;">

	        </td>
	        <td style="width:60px;padding-top:10px;">

	        </td>
		</tr>
		<tr>
			<?php 	
				$tstc = new taisanthechapbs();
				$tstc->SoHDTC = $hopdongtindungcansua[0]["SoHDTC"];
				$dstaisanthechap = $tstc->LayDanhSach();
			?>
			<?php 	
				$htv = new hinhthucvaybs();
				$htv->MaHinhThucVay = $hinhthucvay[0]["MaHinhThucVay"];
				$dshinhthucvay = $htv->LayDanhSach();
			?>
			<?php 
				$khachhang = new khachhangbs();
				$khachhang->MaKH = $dstaisanthechap[0]["MaKH"];
				$dskhachhang = $khachhang->LayDanhSach();
			?>
			<td style="padding-top:10px;">
	        	<label for="tenkhachhang">Khách hàng:</label>
	        </td>	       
			<td style="padding-top:10px;">
				<input readonly="readonly" tabindex="1" type="text" id="TenKhachHang" name="TenKhachHang" class="txt" size="12" value="<?php echo $dskhachhang[0]['Ho'] . " ". $dskhachhang[0]['Ten'];?>" onchange="ChuyenMaKhachHang(this.value);GetThongTinKhachHang(this.value);"/>
			</td>
		</tr>
		<tr>
			<td style="padding-top:10px;">
	        	<label for="makhachhang">Tài khoản:</label>      	
	        </td>
			 <td style="padding-top:10px;">
	        	<input readonly="readonly" tabindex="1" type="text" id="MaKH" name="MaKH" class="txt" size="12" value="<?php echo $dskhachhang[0]['MaKH'];?>" />
	        </td>
	        <td style="padding-top:10px;">
	        	<label for="ngaysinh">Ngày sinh:</label>            	
	        </td>	       
			<td style="padding-top:10px;">
	        	<input readonly="readonly" tabindex="1" type="text" id="NgaySinh" name="NgaySinh" class="txt" size="12" value="<?php echo $dskhachhang[0]["NgaySinh"];?>" /> 
	        </td>
		</tr>
		<tr>
			<td style="padding-top:10px;">
	        	<label for="diachi">Địa chỉ:</label>         	
	        </td>	       
			<td style="padding-top:10px;">
	        	<input readonly="readonly" tabindex="1" type="text" id="DiaChi" name="DiaChi" class="txt" size="12" value="<?php echo $dskhachhang[0]["DiaChi"];?>" /> 
	        </td>
			<td style="padding-top:10px;">
	        	<label for="socmnd">Số CMND:</label>        	
	        </td>
			 <td style="padding-top:10px;">
	        	<input readonly="readonly" tabindex="1" type="text" id="SoCMND" name="SoCMND" class="txt" size="12" value="<?php echo $dskhachhang[0]["SoCMND"];?>" /> 
	        </td>
		</tr>
		<tr>
			<td style="padding-top:10px;">
	        	<label for="ngaycap">Ngày cấp:</label>          	
	        </td>	       
			<td style="padding-top:10px;">
	        	<input readonly="readonly" tabindex="1" type="text" id="NgayCap" name="NgayCap" class="txt" size="12" value="<?php echo $dskhachhang[0]["NgayCap"];?>" /> 
	        </td>
			<td style="padding-top:10px;">
	        	<label for="noicap">Nơi cấp:</label>        	
	        </td>
			 <td style="padding-top:10px;">
	        	<input readonly="readonly" tabindex="1" type="text" id="NoiCap" name="NoiCap" class="txt" size="12" value="<?php echo $dskhachhang[0]["NoiCap"];?>" /> 
	        </td>
		</tr>		
		<tr>
			<td style="padding-top:10px;">
	        	<label for="nguoithuake">Người thừa kế:</label>        	
	        </td>	       
			 <td style="padding-top:10px;">
	        	<input readonly="readonly" tabindex="1" type="text" id="NguoiThuaKe" name="NguoiThuaKe" class="txt" size="12" value="<?php echo $dstaisanthechap[0]["NguoiThuaKe"];?>" /> 
	        </td>
	        <td style="padding-top:10px;">
	        	<label for="quanhe">Quan hệ:</label>      	
	        </td>	       
			<td style="padding-top:10px;">
	        	<input readonly="readonly" tabindex="1" type="text" id="QuanHeVoiKH" name="QuanHeVoiKH" class="txt" size="12" value="<?php echo $danhsach[0]["QuanHeVoiKH"];?>" />
	        </td>
		</tr>		
		<tr>
			<td colspan="0">
			<hr>
			</td>
		</tr>
		<tr><td style="padding-top:10px;">
	        	<label for="tstc" style="color: blue;"><strong>- TÀI SẢN THẾ CHẤP -</strong></label>         	
	        </td>
	    </tr>
	    <tr>
			<td style="padding-top:10px;">
	        	<label for="sohdtc">Số HĐTC:</label>         	
	        </td>	       
			<td style="padding-top:10px;">
	        	<input readonly="readonly" tabindex="1" type="text" id="SoHDTC" name="SoHDTC" class="txt" size="12" value="<?php echo $hopdongtindungcansua[0]["SoHDTC"];?>" /> 
	        </td>
			<td style="padding-top:10px;">
	        	<label for="soqsdd">Số QSDĐ:</label>         	
	        </td>	       
			<td style="padding-top:10px;">
	        	<input readonly="readonly" tabindex="1" type="text" id="SoQSDD" name="SoQSDD" class="txt" size="12" value="<?php echo $dstaisanthechap[0]["SoQSDD"];?>" /> 
	        </td>
	    </tr>		
		<tr>
	        <td style="padding-top:10px;">
	        	<label for="tongdientich">Tổng diện tích:</label>        	
	        </td>	       
			<td style="padding-top:10px;">
	        	<input readonly="readonly" tabindex="1" type="text" id="TongDienTich" name="TongDienTich" class="txt" size="12" value="<?php echo $dstaisanthechap[0]["TongDienTich"];?>" />m2 
	        </td>
			<td style="padding-top:10px;">
	        	<label for="giatritaisan">Giá trị tài sản:</label>       	
	        </td>	       
			<td style="padding-top:10px;">
	        	<input readonly="readonly" tabindex="1" type="text" id="GiaTriTaiSan" name="GiaTriTaiSan" class="txt" size="12" value="<?php echo $dstaisanthechap[0]["GiaTriTaiSan"];?>" />đ
	        </td>
		</tr>
		<tr>
			<td colspan="0">
			<hr>
			</td>
		</tr>
		<tr><td style="padding-top:10px;">
	        	<label for="vv" style="color: blue;"><strong>- VAY VỐN -</strong></label>         	
	        </td>
	    </tr>
	    <tr>
			<td style="padding-top:10px;">
	        	<label for="mucchovay">Mức cho vay:</label>       	
	        </td>	       
			<td style="padding-top:10px;">
	        	<input id="MucChoVay" readonly="readonly" tabindex="1" type="text" name="MucChoVay" class="txt" size="12" value="<?php echo $dstaisanthechap[0]["MucChoVay"];?>" />đ
	        </td>
		</tr>
	    <tr>
			<td style="padding-top:10px;">
	        	<label for="sotienchovay">Số tiền cho vay:</label>&nbsp<span class="requirefield">*</span> 
	        </td>
			<td style="padding-top:10px;">
				<input tabindex="1" type="text" name="SoTienVay" class="txt" value="<?php echo $hopdongtindungcansua[0]["SoTienVay"];?>" />   
			</td>
			<td style="padding-top:10px;">
	        	<label for="mucdichvay">Mục đích cho vay:</label>&nbsp<span class="requirefield">*</span> 
	        </td>
			<td style="padding-top:10px;">
				<input tabindex="1" type="text" name="MucDichVay" class="txt" value="<?php echo $hopdongtindungcansua[0]["MucDichChoVay"];?>" />   
			</td>
		</tr>
		<tr>
			<td style="padding-top:15px;">
	        	<label for="mahtvay">Hình thức cho vay:</label>   
	        </td>
			<td style="padding-top:15px;">
				<?php
					$kyhantra = new kyhantrabs();
					$kyhantra->MaKyHanTra =  $hopdongtindungcansua[0]['MaKyHanTra'];
					$dskyhantra = $kyhantra->LayDanhSach();
					$hinhthucvay = new hinhthucvaybs();
					$hinhthucvay->MaHinhThucVay =  $dskyhantra[0]['MaHinhThucVay'];
					$dshinhthucvay = $hinhthucvay->LayDanhSach();
				?>
				<input readonly="readonly" tabindex="1" type="text" name="HinhThucVay" class="txt" value="<?php echo $dshinhthucvay[0]["TenHinhThucVay"];?>" />   		
			</td>
			<td style="padding-top:15px;">
	        	<label for="thoihanvay">Số tháng cho vay:</label>  
	        </td>
			<td style="padding-top:15px;">
				<input readonly="readonly" tabindex="1" type="text" name="SoThangVay" class="txt" value="<?php echo $hopdongtindungcansua[0]["SoThangVay"];?>" />   
			</td>
		</tr>
		<tr>
			<td style="padding-top:15px;">
	        	<label for="ngaylaphopdong">Ngày lập hợp đồng:</label>
	        </td>
			<td style="padding-top:15px;">
				<input readonly="readonly" tabindex="1" type="text" name="NgayLapHopDong" class="txt" value="<?php echo $hopdongtindungcansua[0]["NgayLapHopDong"];?>" />   
			</td>
			<td style="padding-top:15px;">
	        	<label for="ngaydenhan">Ngày đến hạn:</label>
	        </td>
			<td style="padding-top:15px;">
				<input readonly="readonly" tabindex="1" type="text" name="NgayDenHan" class="txt" value="<?php echo $hopdongtindungcansua[0]["NgayDenHan"];?>" />   
			</td>
		</tr>
		<tr>
			<td style="padding-top:15px;">
	        	<label for="hinhthucxuly">Hình thức xử lý <br/>&nbsp &nbsp &nbsp &nbsp tài sản:</label>&nbsp<span class="requirefield">*</span> 
	        </td>
	        <td style="padding-top:15px;">
	        	<input tabindex="1" type="text" name="HinhThucXuLy" class="txt" value="<?php echo $hopdongtindungcansua[0]["HinhThucXuLy"];?>" />   
	    	</td>
			<td style="padding-top:15px;">
	        	<label for="laisuatchovay">Lãi suất cho vay:</label> 
	        </td>
	        <td style="padding-top:15px;">
	        	<input readonly="readonly" tabindex="1" type="text" name="LaiSuatVay" class="txt" value="<?php echo $dshinhthucvay[0]["LaiSuatVay"];?>" />   
	    	</td>
	    </tr>
	    <tr>
	    	<td style="padding-top:15px;">
	        	<label for="kyhantra">Kỳ hạn trả nợ:</label>   
	        </td>
			<td style="padding-top:15px;">
				<input readonly="readonly" tabindex="1" type="text" name="MaKyHanTra" class="txt" value="<?php echo $dskyhantra[0]["TenKyHanTra"];?>" />   		
			</td>
			<td style="padding-top:15px;">
	        	<label for="laisuatquahan">Lãi suất quá hạn:</label> 
	        </td>
	        <td style="padding-top:15px;">
	        	<input readonly="readonly" tabindex="1" type="text" name="LaiSuatQuaHan" class="txt" value="<?php echo $hopdongtindungcansua[0]["LaiSuatQuaHan"];?>" />   
	    	</td>			
		</tr>
		<tr>
			<td colspan="0">
			<hr>
			</td>
		</tr>
		<tr>
			<td style="width:15px;padding-top:10px;">
	        	<label for="sobuttoan">Số bút toán:</label>
	        </td>
	        	<?php
					$kekhaigiaodich = new kekhaigiaodichbs();
					$kekhaigiaodich->SoKheUoc =  $hopdongtindungcansua[0]['SoKheUoc'];
					$dskekhaigd = $kekhaigiaodich->LayDanhSach();
				?>
	        <td style="width:60px;padding-top:10px;">
	        	<input readonly="readonly" tabindex="1" type="text" name="SoButToan" class="txt" value="<?php echo $dskekhaigd[0]["SoButToan"];?>" />   
	        </td>
	        <td style="width:20px;padding-top:10px;">

	        </td>
	        <td style="width:60px;padding-top:10px;">

	        </td>
		</tr>
		<tr>
			<td style="width:15px;padding-top:10px;">
	        	<label for="nhanvienlapso">Nhân viên lập sổ:</label>
	        </td>
	        <td style="width:60px;padding-top:10px;">
	        	<?php 
	        		$nguoidung = new nguoidungbs();
	        		$nguoidung->MaNguoiDung = $_SESSION["MaND"];
	        		$danhsach = $nguoidung->LayDanhSach();
	        		$HoTen = $danhsach[0]["Ho"]." ".$danhsach[0]["Ten"];
	        	?>
	        	<input type="hidden" name="MaNhanVien" value="<?php echo $danhsach[0]['MaNguoiDung'] ?>"/>
	            <input readonly="readonly" tabindex="1" type="text" name="TenNhanVien" class="txt" size="54" value="<?php echo $HoTen; ?>"/>   
	        </td>
	        <td style="width:15px;padding-top:10px;">
	        	<label for="loaigiaodich">Loại giao dịch:</label>   
	        </td>
	        <?php
					$loaigiaodich = new loaigiaodichbs();
					$loaigiaodich->MaLoaiGiaoDich =  $dskekhaigd[0]['MaLoaiGiaoDich'];
					$dsloaigiaodich = $loaigiaodich->LayDanhSach();
				?>
	        <td style="width:60px;padding-top:10px;">
	        	<input readonly="readonly" tabindex="1" type="text" name="MaLoaiGiaoDich" class="txt" value="<?php echo $dsloaigiaodich[0]["TenLoaiGiaoDich"];?>" />   
	        </td>
		</tr>
		<p class="requirefields">(*): Các trường bắt buộc phải có.</p>
</table>
<br/>
<br/>
<p align="center">
	<input type="submit" class="button small blue" value="Cập nhật"/>
	&nbsp &nbsp
	<a href="index.php?do=inphieuchitien&id=<?php echo $_GET["id"];?>" class="button small blue">In phiếu chi tiền</a>	
</p>
</form>
</div>
<br/>
<br/>
<?php
	if(isset($_SESSION["LoiSuaHopDongTinDung"]))
	{
		echo $_SESSION["LoiSuaHopDongTinDung"];
		unset($_SESSION["LoiSuaHopDongTinDung"]);
	}
?>

<script type="text/javascript">
function checkPostArtForm(frm)
{
	
	var numberRe = /^[0-9]+$/;
	if(!frm.SoTienChoVay.value.match(numberRe))
	{	
		alert('Số tiền vay phải là số.');
		frm.SoTienChoVay.focus();
		return false;
	}

	if(frm.SoTienChoVay.value < 10000000)
	{
		alert('Số tiền cho vay phải >= 10 triệu!');
		frm.SoTienChoVay.focus();
		return false;
	}
	
	if(parseFloat(frm.SoTienChoVay.value) > parseFloat(frm.MucChoVay.value))
	{
		alert('Số tiền cho vay phải <= mức cho vay!');
		frm.SoTienChoVay.focus();
		return false;
	}
	
	if(frm.SoThangVay.value <= 0)
	{
		alert('Số tháng vay phải lớn hơn 0');
		frm.SoThangVay.focus();
		return false;
	}
	
	if(frm.MaLoaiGiaoDich.value==0)
	{
		alert('Bạn chưa chọn loại giao dịch');
		frm.MaLoaiGiaoDich.focus();
		return false;
	}
    
    return true;
}
</script>


